package com.example.tarea2a64709;

import com.example.tarea2a64709.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;


public class Inicio extends Activity implements OnClickListener{
	
	ImageView ivInicio;
	ImageButton ibParaiso;
	TextView tvInfoInicio;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_inicio);
        
        ivInicio=(ImageView)findViewById(R.id.ivInicio);
        ibParaiso=(ImageButton)findViewById(R.id.ibParaiso);
        tvInfoInicio=(TextView)findViewById(R.id.tvInfoInicio);
        ibParaiso.setOnClickListener(this);
        
        
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
    	 Intent intent;
    switch (item.getItemId()) {
   
	case R.id.action_inicio:
		intent = new Intent(Inicio.this, Inicio.class);
        startActivity(intent);
		Toast.makeText(Inicio.this, "Seleccionaste inicio", Toast.LENGTH_SHORT).show();		
		break;
	case R.id.action_vida_estudiantil:
		intent = new Intent(Inicio.this, VidaEstudiantil.class);
        startActivity(intent);
		Toast.makeText(Inicio.this, "Seleccionaste vida estudiantil", Toast.LENGTH_SHORT).show();
		break;
	case R.id.action_docencia:
		Toast.makeText(Inicio.this, "Seleccionaste docencia", Toast.LENGTH_SHORT).show();
		break;
	case R.id.action_accion_social:
		Toast.makeText(Inicio.this, "Seleccionaste accion social", Toast.LENGTH_SHORT).show();
		break;
	case R.id.action_como_llegar:
		Toast.makeText(Inicio.this, "Seleccionaste como llegar", Toast.LENGTH_SHORT).show();
		break;
	case R.id.action_mapa:
		Toast.makeText(Inicio.this, "Seleccionaste mapa", Toast.LENGTH_SHORT).show();
		break;
	default:
		break;
	}
        return super.onOptionsItemSelected(item);
    }
    
	/**
	 * A placeholder fragment containing a simple view.
	 */
	public static class PlaceholderFragment extends Fragment {

		public PlaceholderFragment() {
		}

		@Override
		public View onCreateView(LayoutInflater inflater, ViewGroup container,
				Bundle savedInstanceState) {
			View rootView = inflater.inflate(R.layout.activity_inicio,
					container, false);
			return rootView;
		}
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.ibParaiso:
			tvInfoInicio.setText(R.string.info_recinto_paraiso);
			break;

		default:
			break;
		}
		Toast.makeText(Inicio.this, "Exito!!!", Toast.LENGTH_SHORT).show();
	}

}
